#-*- coding:utf-8 -*-
#删除节点中的内容

import ConfigParser

#获取读取文件对象
cf = ConfigParser.ConfigParser()

cf.add_section("db")
#添加option
cf.set("db","dbok","ok")
cf.write(open("pyconf03.db",'w'))


# 直接通过删除节点的形式删除选项
cf.remove_section('client')
cf.write(open("pyconf03.db",'w'))


cf.add_section("school")
#添加option
cf.set("school","class1","2017")
cf.set("school","class2","2018")
cf.set("school","class3","2019")
cf.write(open("pyconf03.db",'w'))

print "添加选项完成后样子",cf.items("school")

cf.remove_option("school","class2")

print "移除选项后",cf.items("school")


